#include <iostream>
#include <thread>
using namespace std;

void threadfun(int a)
{
    cout<<"thread 1 "<<a<<endl; 
}

class MyThread
{
public:
    void operator()(){
        cout<<"thread 3"<<endl;
    }

};

int main()
{
    thread t1(threadfun, 10);
    thread t2( [] {cout<<"thread 2"<<endl;} );
    MyThread mt;
    thread t3(mt);

    t1.join();
    t2.join();
    t3.join();

    cout<<" Main thread! "<<endl;
}